package com.chanjiedata.changbs.module.main;

import android.graphics.Color;
import android.os.Bundle;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chanjiedata.changbs.R;
import com.chanjiedata.changbs.adapter.ProgressAdapter;
import com.chanjiedata.changbs.base.BaseActivity;
import com.chanjiedata.changbs.bean.ProgressBean;
import com.chanjiedata.changbs.utlis.StatusBarUtil;
import com.google.android.material.tabs.TabLayout;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class TodayTradActivity extends BaseActivity {


    @BindView(R.id.back_tv)
    TextView backTv;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tab_layout)
    TabLayout tabLayout;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;

    private ProgressAdapter mAdapter;
    private List<ProgressBean> datas = new ArrayList<>();

    private String[] titles = {"商户交易", "伙伴交易"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_today_trad);
        StatusBarUtil.setStatusBarLightMode(this, Color.parseColor("#ffffff"), true);
        ButterKnife.bind(this);
        tvTitle.setText("今日交易");
        backTv.setOnClickListener(v -> finish());
        initTabLayout();
        initRecycleView();

    }

    private void initRecycleView() {
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mAdapter = new ProgressAdapter(mContext, datas);
        mAdapter.setOnItemClickListener((adapter, view, position) -> {
        });
        mAdapter.bindToRecyclerView(recyclerView);
        mAdapter.setEmptyView(R.layout.recycle_empty);
        ProgressBean progressBean = new ProgressBean();
        progressBean.setName("啊旺旺");
        progressBean.setNumber("100");
        progressBean.setPosition(0);
        progressBean.setProgress(10);
        mAdapter.addData(progressBean);
        mAdapter.addData(progressBean);
        mAdapter.addData(progressBean);
    }


    //设置tablayout
    private void initTabLayout() {

    }
}
